﻿using OSSUtility.Device;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ozone.Device
{
    //配液平台横爪  慧灵横爪
    public class DevHZ : DevBase
    {

        //COM
        public DevHZ(int CommType, string FSrvIP, int FPort) : base(CommType, FSrvIP, FPort)
        {

        }

        public bool OpenJaw()
        {

            //01 10 00 02 00 02 04 41 A0 00 00 66 68 
            byte[] bytesData = new byte[] { 0x01, 0x10, 0x00, 0x02, 0x00, 0x02, 0x04, 0x41, 0xA0, 0x00, 0x00, 0x66, 0x68 };


            byte[] RecvData = session_.sendAndReadByte(bytesData);

            if (RecvData == null)
                return false;

            if (RecvData.Length != 8)
                return false;

            return true;
        }



        public bool CloseJaw()
        {

            //01 10 00 02 00 02 04 00 00 00 00 72 76 
            byte[] bytesData = new byte[] { 0x01, 0x10, 0x00, 0x02, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x72, 0x76 };


            byte[] RecvData = session_.sendAndReadByte(bytesData);

            if (RecvData == null)
                return false;

            if (RecvData.Length != 8)
                return false;

            return true;
        }
    }
}
